<template>
	<view class="zone">
		<u-navbar :is-back="false"  :background="background" :border-bottom="false">
			<view class="slot-wrap">
				<view class="nav-bar">
					<u-icon class="back" size="20px"  @click="$p.back()" name="arrow-left"></u-icon>
					<text>排行榜</text>
				</view>
			</view>
		</u-navbar>

		<view class="main">
			<view class="outside">
				<image class="rankword" src="http://img.cpgm.cc/panda/static/feed/rank.png" mode="widthFix" />
				<image class="img2" src="http://img.cpgm.cc/panda/static/feed/paihang.png" mode="widthFix" />
				<scroll-view scroll-y class="box">
					<view class="p_list" v-for="(item,index) in datalist" :key="index" :class="[index == 0?'bg1':index == 1?'bg2':index == 2?'bg3':'']">
						<view class="pl_left">
							<image class="lv" v-if=" index == 0 " src="http://img.cpgm.cc/panda/static/public/one.png" mode="widthFix" />
							<image class="lv" v-if=" index == 1 " src="http://img.cpgm.cc/panda/static/public/two.png" mode="widthFix" />
							<image class="lv" v-if=" index == 2 " src="http://img.cpgm.cc/panda/static/public/three.png" mode="widthFix" />
							<view v-if="index > 2" class="lvbox">{{index + 1}}</view>
							<view class="header">
								<image :src="item.wx_img? item.wx_img :'http://img.cpgm.cc/panda/static/login/logo.png'" mode="widthFix" />
							</view>
							<text :class="[index == 0?'c1':index == 1?'c2':index == 2?'c3':'']">{{item.wx_nickname?item.wx_nickname:'潮玩新人'}}</text>
						</view>
						<view class="pl_r">
							<p><text>{{item.numbers}}</text>个</p>
							<p>瓜分水晶数</p>
						</view>
					</view>
					<view class="nonelog" v-if="datalist == ''">
						无记录，快去喂神兽分奖金吧
					</view>
				</scroll-view>
			</view>
		</view>

		<!-- <Userinfo :id="p_userid" :type="1" ref="info"></Userinfo> -->

	</view>
</template>

<script>
import config from '@/common/config/index'
	export default {
		data() {
			return {
				datalist:'',
				imgurl:config.imgurl,
				headerimgurl:config.headerimgurl,
				p_userid:'',
				background:{
					background:'#C7DDDA'
				}
			};
		},
		onLoad(){
			this.Animalsrank()
		},
		methods: {
			async Animalsrank(){
				let res = await this.$http.index.Animalsrank();
				this.datalist = res.data
			},
			// 参看个人信息
			seeinfo(item){
				this.p_userid = String(item.u_id);
				setTimeout(() => {
					this.$refs.info.show()
				}, 100);
			},
		},
	}
</script>

<style lang="less">

.zone {
	min-height: 100vh;
	background: linear-gradient(180deg, #C7DDDA 0%, #C7DDDA 100%);
	background-size: 100% 100%;
}
	.main {
		padding: 45px 12px 12px;
	}

	.rankword {
		width: 20%;
	}

	.img2 {
		width:100px;
		position: absolute;
		top: -5.5%;
		right:0;
		z-index: 99;
	}

	.p_tlt {
		background: rgba(255,255,255,0.13);
		border-radius: 5px;
		padding: 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;

		text {
			color: #C3C3C3;
		}
	}

	.p_list {
		background: #FFF9F3;
		border-radius: 5px;
		padding: 10px;
		margin: 5px 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.lv {
		width: 30px;
	}

	.bg1 {
		background: linear-gradient(180deg, #FFF8B5 0%, #FFFFEB 100%) !important;
	}
	.bg2 {
		background: linear-gradient(180deg, #C6DEFF 0%, #E7F2FF 100%) !important;
	}
	.bg3 {
		background: linear-gradient(180deg, #FFDECB 0%, #FFF2E2 100%) !important;
	}
	.c1 {
		color: #BF7A1C !important;
	}
	.c2 {
		color: #6276CE !important;
	}
	.c3 {
		color: #A63414 !important;
	}

	.pl_left {
		display: flex;
		align-items: center;

		text {
			color: #343434;
			font-size: 13px;
		}
	}

	.header {
			position: relative;
			width: 50px;
			height: 50px;
			display: flex;
			align-items: center;
			justify-content: center;
			margin: 0 10px;

			image {
				width: 45px;
				height: 45px;
				border-radius: 50%;
			}
		}
		
		
	
	.pl_r {
		min-width: 30%;
		display: flex;
		align-items: center;
		flex-direction: column;

		p {
			font-size: 12px;
			color: #696969;
			text {
				color: #239D4C;
				font-size: 14px;
			}
		}
		p:nth-child(2) {
			color: #696969;
			font-size: 12px;
			zoom: 0.8;
			margin-top: 2px;
		}
	}

	.outside {
		position: relative;
		background: url('http://img.cpgm.cc/panda/static/feed/bg3.png');
		background-size: 100% 100%;
		padding: 10px;
		box-sizing: border-box;
	}
	.box {
		height: calc(100vh - 150px);
		box-sizing: border-box;
	}
	.lvbox {
		width: 30px;
		height: 30px;
		text-align: center;
		line-height: 30px;
		color: #343434;
		font-size: 16px;
		font-weight: 600;
	}

	.nonelog {
		color: #696969;
		line-height: 50vh;
		font-size: 12px;
		text-align: center;
	}

</style>
